From: Florian Müllner Date: Sat, 6 Sep 2014 13:27:52 +0000 (+0200) Subject: extensionPrefs: Improve handling of OutOfDate extensions X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2172 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=593acb954d096dcc656176eefb8ef55dcf9b2394;p=gnome-shell.git extensionPrefs: Improve handling of OutOfDate extensions Our current UI is horrible in dealing with outdated extensions - we don't give users any indication at all that something is not working as expected (unless hiding the prefs button as we did until the last commit counts). To fix this, make the enable switch insensitive to indicate OutOfDate extensions. https://bugzilla.gnome.org/show_bug.cgi?id=736185 --- diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js index f56e5b6d4..e4d2e96bd 100644 --- a/js/extensionPrefs/main.js +++ b/js/extensionPrefs/main.js @@ -281,6 +281,10 @@ const ExtensionRow = new Lang.Class({ function() { this._switch.state = this._isEnabled(); })); + this._settings.connect('changed::disable-extension-version-validation', + Lang.bind(this, function() { + this._switch.sensitive = this._canEnable(); + })); this._buildUI(); }, @@ -319,6 +323,7 @@ const ExtensionRow = new Lang.Class({ this.prefsButton = button; this._switch = new Gtk.Switch({ valign: Gtk.Align.CENTER, + sensitive: this._canEnable(), state: this._isEnabled() }); this._switch.connect('notify::active', Lang.bind(this, function() { @@ -331,6 +336,13 @@ const ExtensionRow = new Lang.Class({ hbox.add(this._switch); }, + _canEnable: function() { + let extension = ExtensionUtils.extensions[this.uuid]; + let checkVersion = !this._settings.get_boolean('disable-extension-version-validation'); + + return !(checkVersion && ExtensionUtils.isOutOfDate(extension)); + }, + _isEnabled: function() { let extensions = this._settings.get_strv('enabled-extensions'); return extensions.indexOf(this.uuid) != -1;